{extend name="web/public/base" /}
{block name="header"}
{/block}
{block name="main"}
<section class="scrollable padder">
    <ul class="breadcrumb no-border no-radius b-b b-light pull-in">
        <li><a><i class="fa fa-home"></i> 首页</a></li>
        <li class="active">会员管理</li>
        <li class="active">{$title}</li>
    </ul>
    <div class="row">
        <div class="col-sm-12">
            <section class="panel panel-default">
                <header class="panel-heading"> {$title}</header>
                {include file="web/public/search" /}
                {notempty name="_list"}
                <div class="table-responsive">
                    <table class="table table-striped table-hover b-t b-light text-sm">
                        <thead>
                        <tr>
                            <th width="80px" onclick="sort('user_num',this)" class="th-sortable active"
                                data-toggle="class">ID号 <span class="th-sort"> <i
                                    class="fa fa-sort-down text"></i> <i class="fa fa-sort-up text-active"></i> <i
                                    class="fa fa-sort"></i> </span>
                            </th>
                            <th>会员账号[会员姓名]</th>
                            <th>推荐人</th>
                            <!--<th>报单中心</th>-->
                            <th>注册时间</th>
                            <th>会员状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name='_list' id='vo'}
                        <tr>
                            <td>{$vo.uid}[{$vo.usernumber}]</td>
                            <td>{$vo.realname}</td>
                            <td>{$vo.tuijianid|getInfo="usernumber",###}</td>
                            <!--<td>{$vo.billcenterid|getInfo="usernumber",###}</td>-->
                            <td>{$vo.reg_time|date='Y-m-d H:i:s',###}</td>
                            <td>{$vo.status|get_status}</td>
                            <td>
                                <a class="btn btn-success" href="javascript:;" onclick="active({$vo.uid});">激活</a>
                                <a class="btn btn-danger" href="javascript:;" onclick="del({$vo.uid});">删除</a>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
                <footer class="panel-footer">
                    <div class="row">
                        <div class="text-right text-center-xs">
                            {$page}
                        </div>
                    </div>
                </footer>
                {else/}
                <div style="text-align: center">
                    <image src="__PUBLIC__/images/empty.jpg"></image>
                </div>
                {/notempty}
            </section>
        </div>
    </div>
</section>
{/block}
{block name="script"}
<script type="text/javascript">
    function active(uid) {
        var index = layer.load('正在激活，请耐心等待');
        var url = "{:url('User/activeUser')}";
        $.post(url, {id: uid}, function (data) {
            layer.close(index);
            layer.msg(data.msg);
            if(data.code){
                location.href = data.url;
            }else{
                location.reload();
            }

        }, "json");
        return false;
    }
    function del(uid) {
        var index = layer.load('正在删除，请耐心等待');
        var url = "{:url('User/delMember')}";
        $.post(url, {id: uid}, function (data) {
            layer.close(index);
            layer.msg(data.msg);
            location.reload();
        }, "json");
        return false;
    }
</script>
{/block}
{block name="footer"}
{/block}